import java.io.File;

public class Demo6 {
    public static void main(String[] args) {
        // src是源 dest是目标
        File srcfile = new File("d:/test1.txt");
        File destfile = new File("d:/test2.txt");

        // 把源改成目标
        boolean ret = srcfile.renameTo(destfile);
        System.out.println("ret = " + ret);
    }
}
